package org.sharing.action.interceptor;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class AuthorityInterceptor extends AbstractInterceptor{
	
	public String intercept(ActionInvocation arg0) throws Exception {
		ActionContext ctx = arg0.getInvocationContext();
		if(ctx.getSession().get("user")==null)
		{
			ctx.getSession().put("flag", "3");
			return Action.LOGIN;
		}
		else
			return arg0.invoke();
	}
}
